package com.example.demo.runner;

import com.example.demo.properties.ChildInfoProps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(value = 1)
public class ChildInfoRunner implements ApplicationRunner {

    @Autowired
    private ChildInfoProps props;

    @Override
    public void run(ApplicationArguments args) throws Exception {

        System.out.println("自定义配置文件child.yml信息,如下:");
        System.out.println("name:" + props.getName() + ",sex:" + props.getSex() + ",height:" + props.getHeight() + ",weight:" + props.getWeight());

    }
}
